<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: IPv6 Zones</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__ip6__zones.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">IPv6 Zones<div class="ingroups"><a class="el" href="group__api.html">APIs</a> &raquo; <a class="el" href="group__callbackstyle__api.html">&quot;raw&quot; APIs</a> &raquo; <a class="el" href="group__ip.html">IP</a> &raquo; <a class="el" href="group__ip6.html">IPv6</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga2049167d1715b9a9cf2730e122c0d4fb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga2049167d1715b9a9cf2730e122c0d4fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa090e54f632c8512a7991307e011c1b9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gaa090e54f632c8512a7991307e011c1b9">IPADDR6_ZONE_INIT</a>&#160;&#160;&#160;, <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a></td></tr>
<tr class="separator:gaa090e54f632c8512a7991307e011c1b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee83e12649fa9706857c9ad8f9ef8634"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gaee83e12649fa9706857c9ad8f9ef8634">ip6_addr_zone</a>(ip6addr)&#160;&#160;&#160;((ip6addr)-&gt;zone)</td></tr>
<tr class="separator:gaee83e12649fa9706857c9ad8f9ef8634"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8727c081b6a80992881d481d0680db78"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga8727c081b6a80992881d481d0680db78">ip6_addr_has_zone</a>(ip6addr)&#160;&#160;&#160;(<a class="el" href="group__ip6__zones.html#gaee83e12649fa9706857c9ad8f9ef8634">ip6_addr_zone</a>(ip6addr) != <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a>)</td></tr>
<tr class="separator:ga8727c081b6a80992881d481d0680db78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga213310b303dd050da7856d67da72abd6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga213310b303dd050da7856d67da72abd6">ip6_addr_set_zone</a>(ip6addr,  zone_idx)&#160;&#160;&#160;((ip6addr)-&gt;zone = (zone_idx))</td></tr>
<tr class="separator:ga213310b303dd050da7856d67da72abd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0249db6cd2687f2dbc445e7778d37ad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gae0249db6cd2687f2dbc445e7778d37ad">ip6_addr_clear_zone</a>(ip6addr)&#160;&#160;&#160;((ip6addr)-&gt;zone = <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a>)</td></tr>
<tr class="separator:gae0249db6cd2687f2dbc445e7778d37ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7347729485d837bcff85ae4731bbf5c4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga7347729485d837bcff85ae4731bbf5c4">ip6_addr_copy_zone</a>(ip6addr1,  ip6addr2)&#160;&#160;&#160;((ip6addr1).zone = (ip6addr2).zone)</td></tr>
<tr class="separator:ga7347729485d837bcff85ae4731bbf5c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeead8379cc3fd4c257be0bb654994a8f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gaeead8379cc3fd4c257be0bb654994a8f">ip6_addr_equals_zone</a>(ip6addr,  zone_idx)&#160;&#160;&#160;((ip6addr)-&gt;zone == (zone_idx))</td></tr>
<tr class="separator:gaeead8379cc3fd4c257be0bb654994a8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbb8e1a7505d9772181defa0e75b8da9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gacbb8e1a7505d9772181defa0e75b8da9">ip6_addr_cmp_zone</a>(ip6addr1,  ip6addr2)&#160;&#160;&#160;((ip6addr1)-&gt;zone == (ip6addr2)-&gt;zone)</td></tr>
<tr class="separator:gacbb8e1a7505d9772181defa0e75b8da9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae677a65970f4b667156b256dd9a4924b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gae677a65970f4b667156b256dd9a4924b">IPV6_CUSTOM_SCOPES</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:gae677a65970f4b667156b256dd9a4924b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa5332bb3b70c1a9acba1bea3ea0ecb90"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>(ip6addr,  type)</td></tr>
<tr class="separator:gaa5332bb3b70c1a9acba1bea3ea0ecb90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1040a3d67498a1ef617bda8d9e0ba3a5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga1040a3d67498a1ef617bda8d9e0ba3a5">ip6_addr_assign_zone</a>(ip6addr,  type,  <a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:ga1040a3d67498a1ef617bda8d9e0ba3a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3ec5f94e1cd62b1237efca3723dc06e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gac3ec5f94e1cd62b1237efca3723dc06e">ip6_addr_test_zone</a>(ip6addr,  <a class="el" href="structnetif.html">netif</a>)&#160;&#160;&#160;(<a class="el" href="group__ip6__zones.html#gaeead8379cc3fd4c257be0bb654994a8f">ip6_addr_equals_zone</a>((ip6addr), netif_get_index(<a class="el" href="structnetif.html">netif</a>)))</td></tr>
<tr class="separator:gac3ec5f94e1cd62b1237efca3723dc06e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad963bf3e9695ba898271e314975f5c97"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gad963bf3e9695ba898271e314975f5c97">ip6_addr_lacks_zone</a>(ip6addr,  type)&#160;&#160;&#160;(!<a class="el" href="group__ip6__zones.html#ga8727c081b6a80992881d481d0680db78">ip6_addr_has_zone</a>(ip6addr) &amp;&amp; <a class="el" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>((ip6addr), (type)))</td></tr>
<tr class="separator:gad963bf3e9695ba898271e314975f5c97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac83f3e7c8d65d3c784bffc9dec29b70c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#gac83f3e7c8d65d3c784bffc9dec29b70c">ip6_addr_select_zone</a>(dest,  src)</td></tr>
<tr class="separator:gac83f3e7c8d65d3c784bffc9dec29b70c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga1993c4b6a297b6e92d80a9ce46ddedfe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ip6__zones.html#ga1993c4b6a297b6e92d80a9ce46ddedfe">lwip_ipv6_scope_type</a> { <a class="el" href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaddb1d298ce96cea5ccc8e1397443dbb8">IP6_UNKNOWN</a> = 0, 
<a class="el" href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaacbcc65569837d437eea53c3bbb017b0">IP6_UNICAST</a> = 1, 
<a class="el" href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfea70cda997b66f3e120e925c5a41904809">IP6_MULTICAST</a> = 2
 }</td></tr>
<tr class="separator:ga1993c4b6a297b6e92d80a9ce46ddedfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga1040a3d67498a1ef617bda8d9e0ba3a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1040a3d67498a1ef617bda8d9e0ba3a5">&#9670;&nbsp;</a></span>ip6_addr_assign_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_assign_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="structnetif.html">netif</a>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">(<a class="code" href="group__ip6__zones.html#ga213310b303dd050da7856d67da72abd6">ip6_addr_set_zone</a>((ip6addr), \</div><div class="line">      <a class="code" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>((ip6addr), (type)) ? netif_get_index(<a class="code" href="structnetif.html">netif</a>) : 0))</div><div class="ttc" id="group__ip6__zones_html_gaa5332bb3b70c1a9acba1bea3ea0ecb90"><div class="ttname"><a href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a></div><div class="ttdeci">#define ip6_addr_has_scope(ip6addr, type)</div><div class="ttdef"><b>Definition:</b> ip6_zone.h:177</div></div>
<div class="ttc" id="group__ip6__zones_html_ga213310b303dd050da7856d67da72abd6"><div class="ttname"><a href="group__ip6__zones.html#ga213310b303dd050da7856d67da72abd6">ip6_addr_set_zone</a></div><div class="ttdeci">#define ip6_addr_set_zone(ip6addr, zone_idx)</div><div class="ttdef"><b>Definition:</b> ip6_zone.h:115</div></div>
<div class="ttc" id="structnetif_html"><div class="ttname"><a href="structnetif.html">netif</a></div><div class="ttdef"><b>Definition:</b> netif.h:260</div></div>
</div><!-- fragment --><p>Assign a zone index to an IPv6 address, based on a network interface. If the given address has a scope, the assigned zone index is that scope's zone of the given netif; otherwise, the assigned zone index is "no zone".</p>
<p>This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined, and the zone index of both of those scopes always equals the index of the network interface. As such, this default implementation need not distinguish between different constrained scopes when assigning the zone.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ip6addr</td><td>the IPv6 address; its address part is examined, and its zone index is assigned. </td></tr>
    <tr><td class="paramname">type</td><td>address type; see <a class="el" href="group__ip6__zones.html#ga1993c4b6a297b6e92d80a9ce46ddedfe">lwip_ipv6_scope_type</a>. </td></tr>
    <tr><td class="paramname">netif</td><td>the network interface (const). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae0249db6cd2687f2dbc445e7778d37ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0249db6cd2687f2dbc445e7778d37ad">&#9670;&nbsp;</a></span>ip6_addr_clear_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_clear_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr</td><td>)</td>
          <td>&#160;&#160;&#160;((ip6addr)-&gt;zone = <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clear the zone field of an IPv6 address, setting it to "no zone". </p>

</div>
</div>
<a id="gacbb8e1a7505d9772181defa0e75b8da9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacbb8e1a7505d9772181defa0e75b8da9">&#9670;&nbsp;</a></span>ip6_addr_cmp_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_cmp_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr1, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr2&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((ip6addr1)-&gt;zone == (ip6addr2)-&gt;zone)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Are the zone fields of the given IPv6 addresses equal? (0/1) This macro must only be used on IPv6 addresses of the same scope. </p>

</div>
</div>
<a id="ga7347729485d837bcff85ae4731bbf5c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7347729485d837bcff85ae4731bbf5c4">&#9670;&nbsp;</a></span>ip6_addr_copy_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_copy_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr1, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr2&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((ip6addr1).zone = (ip6addr2).zone)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy the zone field from the second IPv6 address to the first one. </p>

</div>
</div>
<a id="gaeead8379cc3fd4c257be0bb654994a8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeead8379cc3fd4c257be0bb654994a8f">&#9670;&nbsp;</a></span>ip6_addr_equals_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_equals_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">zone_idx&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((ip6addr)-&gt;zone == (zone_idx))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Is the zone field of the given IPv6 address equal to the given zone index? (0/1) </p>

</div>
</div>
<a id="gaa5332bb3b70c1a9acba1bea3ea0ecb90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5332bb3b70c1a9acba1bea3ea0ecb90">&#9670;&nbsp;</a></span>ip6_addr_has_scope</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_has_scope</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">(ip6_addr_islinklocal(ip6addr) || (((type) != <a class="code" href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaacbcc65569837d437eea53c3bbb017b0">IP6_UNICAST</a>) &amp;&amp; \</div><div class="line">   (ip6_addr_ismulticast_iflocal(ip6addr) || \</div><div class="line">    ip6_addr_ismulticast_linklocal(ip6addr))))</div><div class="ttc" id="group__ip6__zones_html_gga1993c4b6a297b6e92d80a9ce46ddedfeaacbcc65569837d437eea53c3bbb017b0"><div class="ttname"><a href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaacbcc65569837d437eea53c3bbb017b0">IP6_UNICAST</a></div><div class="ttdef"><b>Definition:</b> ip6_zone.h:141</div></div>
</div><!-- fragment --><p>Determine whether an IPv6 address has a constrained scope, and as such is meaningful only if accompanied by a zone index to identify the scope's zone. The given address type may be used to eliminate at compile time certain checks that will evaluate to false at run time anyway.</p>
<p>This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined.</p>
<p>Even though the unicast loopback address does have an implied link-local scope, in this implementation it does not have an explicitly assigned zone index. As such it should not be tested for in this macro.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ip6addr</td><td>the IPv6 address (const); only its address part is examined. </td></tr>
    <tr><td class="paramname">type</td><td>address type; see <a class="el" href="group__ip6__zones.html#ga1993c4b6a297b6e92d80a9ce46ddedfe">lwip_ipv6_scope_type</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if the address has a constrained scope, 0 if it does not. </dd></dl>

</div>
</div>
<a id="ga8727c081b6a80992881d481d0680db78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8727c081b6a80992881d481d0680db78">&#9670;&nbsp;</a></span>ip6_addr_has_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_has_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr</td><td>)</td>
          <td>&#160;&#160;&#160;(<a class="el" href="group__ip6__zones.html#gaee83e12649fa9706857c9ad8f9ef8634">ip6_addr_zone</a>(ip6addr) != <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Does the given IPv6 address have a zone set? (0/1) </p>

</div>
</div>
<a id="gad963bf3e9695ba898271e314975f5c97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad963bf3e9695ba898271e314975f5c97">&#9670;&nbsp;</a></span>ip6_addr_lacks_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_lacks_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(!<a class="el" href="group__ip6__zones.html#ga8727c081b6a80992881d481d0680db78">ip6_addr_has_zone</a>(ip6addr) &amp;&amp; <a class="el" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>((ip6addr), (type)))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Does the given IPv6 address have a scope, and as such should also have a zone to be meaningful, but does not actually have a zone? (0/1) </p>

</div>
</div>
<a id="gac83f3e7c8d65d3c784bffc9dec29b70c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac83f3e7c8d65d3c784bffc9dec29b70c">&#9670;&nbsp;</a></span>ip6_addr_select_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_select_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dest, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">src&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { <span class="keyword">struct </span><a class="code" href="structnetif.html">netif</a> *selected_netif; \</div><div class="line">  selected_netif = <a class="code" href="ip6_8c.html#a1153bd9e8c45847282105ab6379e6e70">ip6_route</a>((src), (dest)); \</div><div class="line">  if (selected_netif != NULL) { \</div><div class="line">    ip6_addr_assign_zone((dest), <a class="code" href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaddb1d298ce96cea5ccc8e1397443dbb8">IP6_UNKNOWN</a>, selected_netif); \</div><div class="line">  } } <span class="keywordflow">while</span> (0)</div><div class="ttc" id="structnetif_html"><div class="ttname"><a href="structnetif.html">netif</a></div><div class="ttdef"><b>Definition:</b> netif.h:260</div></div>
<div class="ttc" id="ip6_8c_html_a1153bd9e8c45847282105ab6379e6e70"><div class="ttname"><a href="ip6_8c.html#a1153bd9e8c45847282105ab6379e6e70">ip6_route</a></div><div class="ttdeci">struct netif * ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest)</div><div class="ttdef"><b>Definition:</b> ip6.c:86</div></div>
<div class="ttc" id="group__ip6__zones_html_gga1993c4b6a297b6e92d80a9ce46ddedfeaddb1d298ce96cea5ccc8e1397443dbb8"><div class="ttname"><a href="group__ip6__zones.html#gga1993c4b6a297b6e92d80a9ce46ddedfeaddb1d298ce96cea5ccc8e1397443dbb8">IP6_UNKNOWN</a></div><div class="ttdef"><b>Definition:</b> ip6_zone.h:139</div></div>
</div><!-- fragment --><p>Try to select a zone for a scoped address that does not yet have a zone. Called from PCB bind and connect routines, for two reasons: 1) to save on this (relatively expensive) selection for every individual packet route operation and 2) to allow the application to obtain the selected zone from the PCB as is customary for e.g. getsockname/getpeername BSD socket calls.</p>
<p>Ideally, callers would always supply a properly zoned address, in which case this function would not be needed. It exists both for compatibility with the BSD socket API (which accepts zoneless destination addresses) and for backward compatibility with pre-scoping lwIP code.</p>
<p>It may be impossible to select a zone, e.g. if there are no netifs. In that case, the address's zone field will be left as is.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dest</td><td>the IPv6 address for which to select and set a zone. </td></tr>
    <tr><td class="paramname">src</td><td>source IPv6 address (const); may be equal to dest. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga213310b303dd050da7856d67da72abd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga213310b303dd050da7856d67da72abd6">&#9670;&nbsp;</a></span>ip6_addr_set_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_set_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">zone_idx&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((ip6addr)-&gt;zone = (zone_idx))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the zone field of an IPv6 address to a particular value. </p>

</div>
</div>
<a id="gac3ec5f94e1cd62b1237efca3723dc06e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3ec5f94e1cd62b1237efca3723dc06e">&#9670;&nbsp;</a></span>ip6_addr_test_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_test_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="structnetif.html">netif</a>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(<a class="el" href="group__ip6__zones.html#gaeead8379cc3fd4c257be0bb654994a8f">ip6_addr_equals_zone</a>((ip6addr), netif_get_index(<a class="el" href="structnetif.html">netif</a>)))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Test whether an IPv6 address is "zone-compatible" with a network interface. That is, test whether the network interface is part of the zone associated with the address. For efficiency, this macro is only ever called if the given address is either scoped or zoned, and thus, it need not test this. If an address is scoped but not zoned, or zoned and not scoped, it is considered not zone-compatible with any netif.</p>
<p>This default implementation follows the default model of RFC 4007, where only interface-local and link-local scopes are defined, and the zone index of both of those scopes always equals the index of the network interface. As such, there is always only one matching netif for a specific zone index, but all call sites of this macro currently support multiple matching netifs as well (at no additional expense in the common case).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ip6addr</td><td>the IPv6 address (const). </td></tr>
    <tr><td class="paramname">netif</td><td>the network interface (const). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if the address is scope-compatible with the netif, 0 if not. </dd></dl>

</div>
</div>
<a id="gaee83e12649fa9706857c9ad8f9ef8634"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaee83e12649fa9706857c9ad8f9ef8634">&#9670;&nbsp;</a></span>ip6_addr_zone</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ip6_addr_zone</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ip6addr</td><td>)</td>
          <td>&#160;&#160;&#160;((ip6addr)-&gt;zone)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return the zone index of the given IPv6 address; possibly "no zone". </p>

</div>
</div>
<a id="ga2049167d1715b9a9cf2730e122c0d4fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2049167d1715b9a9cf2730e122c0d4fb">&#9670;&nbsp;</a></span>IP6_NO_ZONE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define IP6_NO_ZONE&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Identifier for "no zone". </p>

</div>
</div>
<a id="gaa090e54f632c8512a7991307e011c1b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa090e54f632c8512a7991307e011c1b9">&#9670;&nbsp;</a></span>IPADDR6_ZONE_INIT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define IPADDR6_ZONE_INIT&#160;&#160;&#160;, <a class="el" href="group__ip6__zones.html#ga2049167d1715b9a9cf2730e122c0d4fb">IP6_NO_ZONE</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Zone initializer for static IPv6 address initialization, including comma. </p>

</div>
</div>
<a id="gae677a65970f4b667156b256dd9a4924b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae677a65970f4b667156b256dd9a4924b">&#9670;&nbsp;</a></span>IPV6_CUSTOM_SCOPES</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define IPV6_CUSTOM_SCOPES&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>IPV6_CUSTOM_SCOPES: together, the following three macro definitions, <a class="el" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>, <a class="el" href="group__ip6__zones.html#ga1040a3d67498a1ef617bda8d9e0ba3a5">ip6_addr_assign_zone</a>, and <a class="el" href="group__ip6__zones.html#gac3ec5f94e1cd62b1237efca3723dc06e">ip6_addr_test_zone</a>, completely define the lwIP scoping policy. The definitions below implement the default policy from RFC 4007 Sec. 6. Should an implementation desire to implement a different policy, it can define IPV6_CUSTOM_SCOPES to 1 and supply its own definitions for the three macros instead. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga1993c4b6a297b6e92d80a9ce46ddedfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1993c4b6a297b6e92d80a9ce46ddedfe">&#9670;&nbsp;</a></span>lwip_ipv6_scope_type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__ip6__zones.html#ga1993c4b6a297b6e92d80a9ce46ddedfe">lwip_ipv6_scope_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Symbolic constants for the 'type' parameters in some of the macros. These exist for efficiency only, allowing the macros to avoid certain tests when the address is known not to be of a certain type. Dead code elimination will do the rest. IP6_MULTICAST is supported but currently not optimized. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__ip6__zones.html#gaa5332bb3b70c1a9acba1bea3ea0ecb90">ip6_addr_has_scope</a>, <a class="el" href="group__ip6__zones.html#ga1040a3d67498a1ef617bda8d9e0ba3a5">ip6_addr_assign_zone</a>, <a class="el" href="group__ip6__zones.html#gad963bf3e9695ba898271e314975f5c97">ip6_addr_lacks_zone</a>. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1993c4b6a297b6e92d80a9ce46ddedfeaddb1d298ce96cea5ccc8e1397443dbb8"></a>IP6_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1993c4b6a297b6e92d80a9ce46ddedfeaacbcc65569837d437eea53c3bbb017b0"></a>IP6_UNICAST&#160;</td><td class="fielddoc"><p>Unicast </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1993c4b6a297b6e92d80a9ce46ddedfea70cda997b66f3e120e925c5a41904809"></a>IP6_MULTICAST&#160;</td><td class="fielddoc"><p>Multicast </p>
</td></tr>
</table>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
